package com.mhuang.module.common.service;

import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import com.mhuang.common.utils.network.CommonPostParamers;

public class BaseService {

	
	public static void usePostParamerterByMap(Map<String, String> map,CommonPostParamers params){
		 Set<Entry<String, String>>  entrySet = map.entrySet();
		 for(Entry<String,String> entry:entrySet){
			 params.addString(entry.getKey(), entry.getValue());
		 }
	}
	
	public static void useGetParamerterByMap(StringBuilder webUrl,Map<String, String> map){
	    Set<Entry<String, String>>  entrySet = map.entrySet();
	    boolean a = false;
        for(Entry<String,String> entry:entrySet){
            if(!a){
                a = true;
                webUrl.append("?").append(entry.getKey())
                .append("=").append(entry.getValue());
            }else{
                webUrl.append("&").append(entry.getKey())
                .append("=").append(entry.getValue());
            }
        }
	}
}
